package my.test.constructor.bean;

import my.test.constructor.bean.collection.DataSource;
import my.test.constructor.bean.collection.NewPerson;
import my.test.constructor.bean.collection.RichPerson;
import my.test.lookup.bean.GetBeanTest;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
	public static void main(String[] args) {
		ApplicationContext bf = new ClassPathXmlApplicationContext("/my/test/constructor/bean/constructorArgTest.xml");
		//index属性
		Car car=(Car)bf.getBean("car");
		System.out.println(car);
		//type属性
		car=(Car)bf.getBean("car2");
		System.out.println(car);
		//ref属性
		Person person=(Person) bf.getBean("person2");
		System.out.println(person);
		//list属性
		RichPerson person3 = (RichPerson) bf.getBean("person3");
		System.out.println(person3);
		//map属性
		NewPerson person4 = (NewPerson) bf.getBean("person4");
		System.out.println(person4);
		//prop属性
		DataSource dataSource = (DataSource) bf.getBean("dataSource");
		System.out.println(dataSource);
	}
}
